﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package  net.libra.loader.mission{
    import flash.utils.*;
    import flash.display.*;
    import flash.events.*;
    import net.libra.nochump.util.zip.*;
    import flash.system.*;

    public class LibraryMission extends LoaderMission {

        public function LibraryMission(name:String, path:String, useCache:Boolean=true, cacheType:uint=1, key:String=null, data:Object=null){
            super(name, path, useCache, cacheType, key, data);
        }
        override public function convert(source:ByteArray):void{
            original = source;
            var useBytes:ByteArray = bytes;
            loader = new Loader();
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handler);
            loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handler);
            useBytes.position = 0;
            var zipFile:ZipFile = new ZipFile(useBytes);
            var zipEntry:ZipEntry = zipFile.getEntry("library.swf");
            useBytes = zipFile.getInput(zipEntry);
            loader.loadBytes(useBytes, new LoaderContext(false, applicationDomain));
        }
    }
}//package net.l4cd.loader.mission 
